<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>

<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<title>Insert title here</title>
</head>
<body>
	<div style="background-color:red;height:200px;font:" >
	<h1 >这是一个标签</h1>
	</div>
	<div style="background-color:gray;height: 699px">
		<div style="background-color:green;width: 150px;height:699px;float: left">
		<!-- <a href="class.jsp">班级管理</a><hr> -->
		<button type="button" onclick="classlist()">班级管理</button>
		<a href="student.jsp">学生管理</a>
		</div>
	</div>
</body>
</html>
<script>
	function classlist(){
		alert("jjj");
		 $.ajax({
				url:"http://localhost:8080/QingkeCodeApi/clazz/select",
				type:"GET",
				dataType:"json",
				error:function(){
					alert(error);
				},
				success:function(data){
					alert("bbb");
					var result = new Array();
					data.data.record.forEach(function( val, index ) {
						var ob = new Object();
						ob.id=val.cid;
						ob.name = val.className;
						ob.studentnumber=val.studentNumber;
						ob.teacher=val.teacherName;
						ob.starttime=val.startTime;
						ob.endtime=val.endTime;
						result.push(ob);
						console.log(ob.id+"=="+ob.name+"=="+ob.studentnumber+"=="+ob.teacher+"=="+ob.starttime);		
					});
					window.location.href="class.jsp";
				},
		})
	}
</script>